package com.honour.service.interfaced.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.honour.service.interfaced.ConvergeInManager;
import com.system.dao.DaoSupport;
import com.system.util.PageData;

/**
 @Function
 @Author 于泓磊
 @Date   2017年11月16日
*/
@Service("convergeinService")
public class ConvergeInService implements ConvergeInManager {
	

	@Resource(name = "daoSupport")
	private DaoSupport dao;

	/**
	 * 获取汇聚列表接口
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getConvergeList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("ConvergeInMapper.list", pd);
	}

	/**
	 * 获得指定汇聚下所有聚会列表
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getPartyList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("ConvergeInMapper.getpartylist", pd);
	}

	/**
	 * 查看指定聚会详情
	 */
	@Override
	public PageData getDetailById(PageData pd) throws Exception {
		return (PageData) dao.findForObject("ConvergeInMapper.getdetailbyid", pd);
	}

	/**
	 * 发起聚会(添加聚会)
	 */
	@Override
	public void addDetailParty(PageData pd) throws Exception {
		dao.save("ConvergeInMapper.adddetailparty", pd);
	}

	/**
	 * 用户参加别人发起的聚会(添加聚会)
	 */
	@Override
	public void addOtherParty(PageData pd) throws Exception {
		dao.save("ConvergeInMapper.addOtherParty", pd);
	}

	/**
	 * 查看我发布的聚会详情
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getMyLaunchParty(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("ConvergeInMapper.getMyLaunchParty", pd);
	}

	/**
	 * 查看我参与的聚会详情 
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getMyTakeParty(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("ConvergeInMapper.getMyTakeParty", pd);
	}

	@Override
	public PageData getDistanceUserAndUser(PageData pd) throws Exception {
		return (PageData) dao.findForObject("ConvergeInMapper.getDistanceUserAndUser", pd);
	}

	/**
	 * 根据汇聚ID查询分类列表 
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getConvergeSortById(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("ConvergeInMapper.getConvergeSortById", pd);
	}

	/**
	 * 显示汇聚→搜索的图 
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> getSearchConvertByParentId(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("SearchInMapper.getSearchConvertByParentId", pd);
	}
	
}
